package g2.routemaster.gui.wizards;

import g2.routemaster.gui.GManager;
import g2.routemaster.model.GameManager;

import org.eclipse.jface.wizard.Wizard;

public class AddPlayerWizard extends Wizard {
   protected boolean isCompleted = false;
   String playerName = "";
   int playerAge = 0;
   String playerColor = "";
   
   public AddPlayerWizard() {
      super();
      setWindowTitle("Add Player");
   }
   
   public void addPages() {
      AddPlayerPage newPage = new AddPlayerPage();
      addPage(newPage);
   }
   
   public boolean canFinish(){
      return isCompleted;
   }
   
   public boolean performFinish() {
      GameManager gm = GManager.instance().getGameManager();
      gm.insertPlayer(playerName, playerAge, playerColor);      
      return true;
   }

}
